<?php


namespace App\Transformers\Store;


use App\Models\LiveAnchor;
use App\Models\StoreService;
use League\Fractal\TransformerAbstract;

class StoreServiceTransformer extends TransformerAbstract
{
    public function transform(StoreService $data)
    {
        return [
            'id' => $data->id,
            'merchant_id' => $data->merchant_id ?? "",
            'user_id' => $data->user_id ?? "",
            'online' => $data->online ?? 0,
            'account' => $data->account ?? "",
            'password' => $data->password ?? "",
            'avatar' => $data->avatar ?? "",
            'nickname' => $data->nickname ?? "",
            'phone' => $data->phone ?? "",
            'status' => $data->status ?? 0,
            'order_notify' => $data->order_notify ?? 0,
            'customer' => $data->customer ?? 0,
            'uniqid' => $data->uniqid ?? "",
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
